package createThread;

/**
 * @author wang'ji'cheng
 * @date 2025/7/3
 */
public class Demo {
    public static void main(String[] args) {
        //实例化线程
        MyThread myThread = new MyThread();
        myThread.start();

        Thread thread = new Thread(new MyRunnable());
        thread.start();
        System.out.println("main线程");

        Thread thread1 = new Thread(() -> {
            System.out.println("通过lambda表达式创建线程，因为Runnable是一个函数式接口");
        });
        thread1.start();

    }
}
